package com.mk.web.basic.primitive;

/**
 * Created by WangChen on 2018/12/8 12:37.
 */
public class ParamPassing {

    private static int intStatic = 222;
    private static String stringStatic = "old String";
    private static StringBuilder stringBuilderStatic = new StringBuilder("old StringBuilder");

    public static void main(String [] args){

        method(intStatic);
        method(stringStatic);
        method(stringBuilderStatic, stringBuilderStatic);

        System.out.println(intStatic);//222
        method();
        System.out.println(intStatic);//888
        System.out.println(stringStatic);//old String
        System.out.println(stringBuilderStatic);//old StringBuilder.method.first-method.second-
    }

    public static void method(int intStatic){
        intStatic = 777;
    }

    public static void method(){
        intStatic = 888;
    }

    public static void method(String stringStatic){
        stringStatic = "new String";
    }

    public static void method(StringBuilder stringBuilderStatic1, StringBuilder stringBuilderStatic2){
        stringBuilderStatic1.append(".method.first-");
        stringBuilderStatic2.append("method.second-");

        stringBuilderStatic1 = new StringBuilder("new stringBuilder");
        stringBuilderStatic1.append("new method`s append");
    }
}
